﻿@model IEnumerable<ECatalog.Models.Size>
<div class="container">
    <div class="row">
        <p>
            @Html.ActionLink("Добавить размер", "Create", null, new { @class = "btn btn-primary" })
        </p>
        <table class="table table-bordered table-hover">
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.Value)
                </th>
                <th></th>
            </tr>

            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.Value)
                    </td>
                    <td>
                        @Html.ActionLink("Редактировать", "Edit", new { id = item.SizeId })

                        @using (Html.BeginForm("Delete", "Size", new { id = item.SizeId }))
                        {
                            @Html.AntiForgeryToken()
                            <p>
                                <input type="submit" class="btn btn-link" value="Удалить" />
                            </p>
                        }
                    </td>
                </tr>
            }

        </table>
    </div>
</div>
